package com.ygqh.baby.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.YgIndexModel;
import com.ygqh.baby.model.YgNotSaleHeadModel;
import com.ygqh.baby.model.YgSimilarityPublishModel;
import com.ygqh.baby.po.YgPublish;
import com.ygqh.baby.po.YgPublishDetail;
import com.ygqh.baby.po.YgPublishDetailTag;
import com.ygqh.baby.po.YgPublishExample;

public interface YgPublishMapper {
	int countByExample(YgPublishExample example);

	int deleteByExample(YgPublishExample example);

	int deleteByPrimaryKey(Long id);

	int insert(YgPublish record);

	int insertSelective(YgPublish record);

	List<YgPublish> selectByExample(YgPublishExample example);

	YgPublish selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") YgPublish record, @Param("example") YgPublishExample example);

	int updateByExample(@Param("record") YgPublish record, @Param("example") YgPublishExample example);

	int updateByPrimaryKeySelective(YgPublish record);

	int updateByPrimaryKey(YgPublish record);

	int countSuper(@Param("q") String q, @Param("sortField") String sortField, @Param("sort") String sort,
			@Param("checkStatus") String checkStatus,@Param("startTime") Date startTime,@Param("endTime") Date endTime,@Param("id")Long id,@Param("userName") String userName);

	List<YgPublish> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q, @Param("sortField") String sortField, @Param("sort") String sort,
			@Param("checkStatus") String checkStatus,@Param("startTime") Date startTime,@Param("endTime") Date endTime,@Param("id")Long id,@Param("userName") String userName);

	int selectModel4IndexCount();

	int selectModel4UserCount(@Param("obj") Map<String, Object> obj);

	int selectModel4PublishCount(@Param("obj") Map<String, Object> obj);

	List<YgIndexModel> selectModel4Index(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);

	List<YgIndexModel> selectModel4User(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);

	List<YgIndexModel> selectModel4Publish(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);

	YgIndexModel findDetailModel(@Param("id") Long id);

	YgNotSaleHeadModel findNotSaleHeadModel(@Param("pdtId") Long pdtId);

	List<YgSimilarityPublishModel> findSimilarityPublishModelBySkus(@Param("skus") Long[] skus);

	List<YgSimilarityPublishModel> findSimilarityPublishTop10();

	List<YgSimilarityPublishModel> findSimilarityPublishEqualCategory4NotSale(@Param("brandName") String brandName, @Param("categoryId") String categoryId);

	List<YgSimilarityPublishModel> findSimilarityPublishNoEqualCategory4NotSale(@Param("brandName") String brandName, @Param("categoryId") String categoryId);

	int updateBatchChechStatus(@Param("checkBy") String checkBy,@Param("checkStatus") String checkStatus, @Param("ids") Long[] ids);

	List<YgSimilarityPublishModel> findSimilarityPublishModelByProductId(@Param("productIds") Long[] productIds);
	int  insertBatchPublishDetails(@Param("publishDetails") List<YgPublishDetail> publishDetails);

	int insertBatchPublishDetailTags(@Param("publishDetailTags") List<YgPublishDetailTag> publishDetailTags);

	List<YgIndexModel> selectModel4Tag(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);
	int selectModel4TagCount(@Param("obj") Map<String, Object> obj);
	
	
	
	
	
	
	
	
	
	List<YgIndexModel> newSelectModel4Index(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);
	int newSelectModel4IndexCount();

	List<YgIndexModel> newSelectModel4User(@Param("queryInfo") QueryInfo queryInfo,  @Param("obj") Map<String, Object> obj);
	int newSelectModel4UserCount(@Param("obj") Map<String, Object> obj);
	
	List<YgIndexModel> newSelectModel4Publish(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);
	int newSelectModel4PublishCount(@Param("obj") Map<String, Object> obj);
	
	List<YgIndexModel> newSelectModel4Tag(@Param("queryInfo") QueryInfo queryInfo, @Param("obj") Map<String, Object> obj);
	int newSelectModel4TagCount(@Param("obj") Map<String, Object> obj);
}
